<template>
  <div>
    <el-tabs type="border-card" v-model="activeName" @tab-click="tabClick">
      <el-tab-pane
        v-for="item in cardMode"
        :key="item.id"
        :label="item.value"
        :name="item.id"
      >
        <!-- :label="item.value" -->
        <table-item :user_type="item.id" :ref="'table_' + item.id"></table-item>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import { cardMode } from "@/assets/js/common";
import tableItem from "./tableItem";
export default {
  components: {
    tableItem,
  },
  data() {
    return {
      cardMode,
      activeName: "1",
    };
  },
  methods: {
    tabClick(val) {
      this.$refs["table_" + this.activeName][0].toQuery();
    },
  },
};
</script>